#ifndef GT_SEARCH_UTIL_H
#define GT_SEARCH_UTIL_H

#include "isearch.h"

struct external_parser_t {
  const char *default_arguments;

  int (*match_file)(result_t *result, const char *output);
  int (*match_line)(result_t *result, const char *output);
  int (*match_blank_line)(result_t *result, const char *output);
};

void resize_string(char **string, size_t *string_size, size_t minimal_size);
int validate_file(const char *path);
const char *apply_regex(const char *output, char *expr);
void popen_search(search_t *search, external_parser_t *parser);

#endif // header file protect
       // ok